package com.sanjiahantang.youjiaclient.module.me.order.views.impl;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.sanjiahantang.uilibrary.utils.Utils;
import com.sanjiahantang.uilibrary.views.PayPsdInputView;
import com.sanjiahantang.youjiaclient.R;
import com.sanjiahantang.youjiaclient.base.BaseApplication;
import com.sanjiahantang.youjiaclient.base.BaseBean;
import com.sanjiahantang.youjiaclient.base.BaseMvpActivity;
import com.sanjiahantang.youjiaclient.base.CallBack;
import com.sanjiahantang.youjiaclient.config.ConfigValue;
import com.sanjiahantang.youjiaclient.module.me.order.presenters.OrderPresenter;
import com.sanjiahantang.youjiaclient.module.me.order.views.OrderView;

/**
 * Created by zy on 2018/3/26.
 */

public class PayByPasswordActivity extends BaseMvpActivity<OrderView,OrderPresenter> implements OrderView {


    @Override
    public void showProgress() {
        super.showProgress($this);
    }

    @Override
    public OrderPresenter initPresenter() {
        return new OrderPresenter();
    }

    @Override
    public void initView() {
        setContentView(R.layout.dialog_pay_password);

        TextView title = (TextView) findViewById(R.id.title);
        title.setText("");
        findViewById(R.id.fl_Left).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        final PayPsdInputView passwordInputView = (PayPsdInputView) findViewById(R.id.passwordView);
        passwordInputView.setComparePassword( new PayPsdInputView.onPasswordListener() {

            @Override
            public void onDifference(String oldPsd, String newPsd) {

            }

            @Override
            public void onEqual(String psd) {
            }

            @Override
            public void inputFinished(final String inputPsd) {
                Intent intent = new Intent();
                intent.putExtra(KEY_PARAM,inputPsd);
                setResult(RESULT_OK,intent);
                finish();
            }
        });
    }

    @Override
    public void initData() {

    }

    public static void startActivity(Activity context, int requestCode){
        Intent mIntent = new Intent(context,PayByPasswordActivity.class);
        context.startActivityForResult(mIntent,requestCode);
    }
}
